//
//  ViewController.m
//  CacheDemo
//
//  Created by liuyonghu on 2019/2/26.
//  Copyright © 2019年 liuyonghu. All rights reserved.
//

#define MYKEY  @"mykey"


#import "ViewController.h"
#import "CacheDataHelper/CacheDataHelper.h"
#import "AController/AController.h"
@interface ViewController ()
@property(nonatomic,strong)CacheDataHelper *cacheDataHelper;
@end


@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    __block AController
    
//    获取工具
    self.cacheDataHelper = [CacheDataHelper shareHelper];
    
    NSDictionary *dic = @{@"key1":@"value1",@"key2":@"value2"};
//    存入缓存
    [_cacheDataHelper saveCacheData:dic byKey:MYKEY];
    // Do any additional setup after loading the view, typically from a nib.
}


- (IBAction)updateCaChe:(id)sender {
    //添加计时   例如：每调用一次 增加 180s
    [self.cacheDataHelper updateBtTimeTypeKey:MYKEY];
}

- (IBAction)getValue:(id)sender {
    //获取缓存
    NSLog(@"getValue == %@",[self.cacheDataHelper getCacheDataByKey:MYKEY]);
}
@end
